package pers.qianyu.auth.controller;

import org.springframework.security.access.prepost.*;
import org.springframework.web.bind.annotation.*;
import pers.qianyu.core.http.*;

@RestController
public class UserController {
    @PreAuthorize("hasAuthority('user:query')")
    @GetMapping(value = "/query")
    public HttpResult query() {
        return HttpResult.ok("query");
    }

    @PreAuthorize("hasAuthority('user:update')")
    @GetMapping(value = "/update")
    public HttpResult update() {
        return HttpResult.ok("update");
    }

    @PreAuthorize("hasAuthority('user:delete')")
    @GetMapping(value = "/delete")
    public HttpResult delete() {
        return HttpResult.ok("delete");
    }

    @PreAuthorize("hasAuthority('user:add')")
    @GetMapping(value = "/add")
    public HttpResult add() {
        return HttpResult.ok("add");
    }
}
